<!DOCTYPE html><html><head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="format-detection" content="telephone=no">
	<title>评论</title>

    <link href="<?php echo TEMPLATE_SITE_URL;?>/css/comment.css" rel="stylesheet" type="text/css">
    <link href="<?php echo TEMPLATE_SITE_URL;?>/css/common.css" rel="stylesheet" type="text/css">
	<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/zepto.js" charset="utf-8"></script>
</head>

<body>

    <div id="contentbox" style="min-height: 576px;">
        <div class="rateMain">
		            <div class="saleItem">
		                <div class="title" style="background-image: url(<?php echo $output['user']['avatar'];?>)">
		                    <div class="nickname">
		                        <a href="index.php?act=my&op=home&uid=<?php echo $output['user']['user_id'];?>"><?php echo $output['user']['nickname'];?></a>
		                    </div>
		                </div>
		
		                <div class="content">
		                    <div class="goodsImg" style="background-image:url(<?php echo UPLOAD_SITE_URL.'/shop/auction/'.$output['auction']['auction_add_date'].'/'.$output['auction']['auction_img1'];?>);"></div>
		                    <div class="desc"><?php echo $output['auction']['auction_description'];?></div>
		                    <ul>
		                        <li><span>成交金额：</span>￥ <?php echo $output['order']['price'];?> 元</li>
		                        <li><span>成交时间：</span><?php echo date("Y年m月d日 H:i",$output['order']['add_time']); ?></li>
		                    </ul>
		                </div>
		            </div>
	                <div class="rate">
	                    <div class="title">拍品评分</div>
	                    <div class="starEmpty">
	                    	<?php if(!empty($output['order']['order_score'])){?>
							<?php for($i=0;$i<5;$i++){?>
							<?php if($i<$output['order']['order_score']){?>
							<span class="starOn"></span>
							<?php }else{?>
							<span class="star"></span>						
							<?php }?>						
							<?php }?>
							<?php }else{?>
							<span class="star fstar" sort="1"></span>	
							<span class="star fstar" sort="2"></span>	
							<span class="star fstar" sort="3"></span>	
							<span class="star fstar" sort="4"></span>	
							<span class="star fstar" sort="5"></span>	
							<?php }?>
	                    </div>
	                    <input type="hidden" name="stars" value="0" id="stars">
	                    <script type="text/javascript">
							$(function(){
								$('.fstar').click(function(){
									var num = parseInt($(this).attr('sort'));
									$('.fstar').each(function(){
										var num1 = parseInt($(this).attr('sort'));
										if(num1<=num){
											$(this).removeClass('star');
											$(this).addClass('starOn');
										}else{
											$(this).removeClass('starOn');
											$(this).addClass('star');
										}
									});
									$('#stars').val(num);
								});
							});
	                    </script>	                    
	                </div>
	                <div class="review">
		                <div class="title">评价</div>
		                <div class="content">
		                	<?php if(!empty($output['order']['order_comment'])){?>
		                	<?php echo $output['order']['order_comment'];?>
		                	<?php }else{?>
		                	<textarea placeholder="亲，写点什么吧！" name="content" id="coment"><?php echo $output['order']['order_comment'];?></textarea>
		                	<?php }?>		                	
		                </div>
	            	</div>
            		<div class="anoyLabel">您的任何评价都会被严格匿名</div>
        		</div>
        		<p class="error" style="margin-left:20px;color:red;display:none;"></p>
        		<?php if(empty($output['order']['order_comment'])){?>
                <button class="ratePublish">提 交</button>
                <?php }?>
            </div>
<script type="text/javascript">
$(function(){
	$('.ratePublish').click(function(){
		var order_id = '<?php echo $_GET['order_id']?>';
		var comment = $('#coment').val();
		var stars = $('#stars').val();

		if((comment=='') || (stars=='0')){
			$('.error').show();
			$('.error').html('评论和点评不能为空');	
			return false;
		}
		
		$.ajax({
			type:'post',
			url:'index.php?act=payment&op=comment',
			data:{order_id:order_id,comment:comment,stars:stars},
			dataType:'json',
			success:function(){
				location.href = 'index.php?act=payment&op=comment&order_id='+order_id;
				return false;
			}
		});
	});
	
});
</script>          
</body>
</html>